package 设计模式.创建型模式.demo05单例模式;

/**
 * @author: 王富贵
 * @description: 饿汉式，一开始就创建，线程安全但不用消耗内存
 * @createTime: 2022/11/07 16:51
 */
public class HungrySingle {
    public static HungrySingle instance = new HungrySingle();
    private HungrySingle() {}

    public HungrySingle getInstance(){
        return instance;
    }
}
